{template 'include/header'}
<div class="container container-fill">
<link rel="stylesheet" type="text/css" href="<?php echo MODULE_URL;?>template/mobile/css/index_1903.css">
<style type='text/css'>
	input,select,button{font-size:100%;vertical-align:middle;outline:0}
	button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;-moz-appearance:button}
	input:focus:-moz-placeholder,input:focus::-webkit-input-placeholder,textarea:focus:-moz-placeholder,textarea:focus::-webkit-input-placeholder{color:transparent}
	button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}
	#poptip { position: fixed; top:40%;left:50%;width:160px;margin-left:-80px;height: 27px;background:#000; opacity: 0.7;filter:alpha(opacity=0.7); color:#fff;z-index: 999;  border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;}
	#poptip_content { position: fixed; top:40%;left:50%;width:160px;margin-left:-80px; height: 27px; color:#fff;text-align:center;font-size:14px;z-index: 9909}
	.hero {background-color: #fff;}
	.menubar {overflow: hidden;padding:5px 0 10px;background: #fff;border-bottom: 1px solid #e8e5e1;margin-bottom: 8px;margin-top:-10px;clear: both;}
	.menubar .li{float: left;width:25%;text-align: center;color: #393939;font-size:12px;}
	.and_healthy {width: 42px;height:42px;background-position: -91px -82px;}
	.and_month {width: 42px;height:42px;background-position: -2px -65px;}
	.and_myrecord {width: 42px;height:42px;background-position: -91px -40px;}
	.and_start {width: 42px;height:42px;background-position: -46px -65px;}
	.and_img {display: inline-block;overflow: hidden;background-repeat: no-repeat;background-size: 137px 128px;background-image: url(<?php echo MODULE_URL;?>template/mobile/img/and_img_2_11.png);}
</style>
<script language='javascript'>
	function tip(msg,autoClose){
		var div = $("#poptip");
		var content =$("#poptip_content");
		if(div.length<=0){
			div = $("<div id='poptip'></div>").appendTo(document.body);
			content =$("<div id='poptip_content'>" + msg + "</div>").appendTo(document.body);
		}else{
			content.html(msg);
			content.show(); div.show();
		}
		if(autoClose) {
			setTimeout(function(){
				content.fadeOut(500);
				div.fadeOut(500);
			},1000);
		}
	}
	function tip_close(){
		$("#poptip").fadeOut(500);
		$("#poptip_content").fadeOut(500);
	}
</script>
<script language="javascript" src="<?php echo MODULE_URL;?>template/mobile/js/touchslider.min.js"></script>
<script language="javascript" src="<?php echo MODULE_URL;?>template/mobile/js/swipe.js"></script>

<style>
.td_a { height:7em; text-align: center}
 /* clock */
.clock{display:inline-block;float:left;height:50px;width:auto;margin:0 1px 0 4px; line-height:normal !important;color:#fff;font-family:"Lato", sans-serif;}
.clock div{position:relative;float:left;background:#08070c; color:#fff;border-radius:0px;width:15px;height:22px;line-height:24px;text-align:center;font-size:13px;margin:13px 2px 0px 0;}
.bor_btm, .bor_top, .bor_left, .bor_right{position: relative;}
.bor_btm:after, .bor_top:after, .bor_left:after, .bor_right:after{content: '';position: absolute; top: 0; left: 0; -webkit-box-sizing: border-box; box-sizing: border-box; width: 200%; height: 200%; -webkit-transform: scale(0.5); transform: scale(0.5); -webkit-transform-origin: left top; transform-origin: left top; }
.bor_btm:after{border-bottom: 1px solid #e7e7e7;}
.bor_top:after{border-top: 1px solid #e7e7e7;}
.bor_left:after{border-left: 1px solid #e7e7e7;}
.bor_right:after{border-right: 1px solid #e7e7e7;}
.bck_btm:after{content: "";display: block;position: absolute;left: -50%;width: 200%;height: 1px;background: #e7e7e7;-webkit-transform:scale(0.5);}
.gy_footer{width: 100%;height: 50px;position: fixed;bottom: 0;left: 0;background: #fff;}
.gy_footer_li{width: 25%;text-align: center;list-style: none;float: left;}
.gy_footer_li_img{width: 22px;margin-top: 6px;}
.gy_footer_li_p{font-size: 12px;line-height: 22px;color: #000;}
.gy_footer_lic p{color: #43ac43 !important;}
.gy_logo img{height: 26px;}
.i_d_t_i{height: 36px;margin-top: 2px; overflow:hidden;text-overflow:ellipsis;display:-webkit-box; -webkit-box-orient:vertical;-webkit-line-clamp:2;}
.progress-bar-warning {background-color: #43ac43 !important;}
.i_d_5_1_r .title{margin: 0 0 16px !important; overflow:hidden;text-overflow:ellipsis;display:-webkit-box; -webkit-box-orient:vertical;-webkit-line-clamp:1;}
.i_d_5_1_l{height: 70px;overflow: hidden;border-radius: 5px;}
.i_d_5_1_l img{min-height: 100%;margin-top: 0px !important;}

.header-button{-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;overflow: hidden;text-align: left;text-transform: capitalize;position: relative;display: block;width: 26px;height:46px;margin: 0;padding: 0;outline: none;border: none;cursor: pointer;background:url(<?php echo MODULE_URL;?>template/mobile/img/flcz.png) no-repeat center center #fff;background-size: 100%; margin:0 3% 0 0;text-indent: -119988px;}

#toggle-search {float: right;}
#toggle-search.open:after {top: 26px;}
#toggle-search:after {-moz-transition: top, 0.5s;-o-transition: top, 0.5s;-webkit-transition: top, 0.5s;transition: top, 0.5s;position: absolute;top: 52px;left: 50%;margin-left: -8px;content: "";border-color: transparent transparent #f2f2f2;border-style: solid;border-width: 8px 8px 12px;}
#search-form {-moz-transition: max-height, 0.5s;-o-transition: max-height, 0.5s;-webkit-transition: max-height, 0.5s;transition: max-height, 0.5s;position: absolute;top: 46px;left: 0;width: 100%;max-height: 0;overflow: hidden;background-color: #f2f2f2;z-index: 10;}
#search-form.open {max-height: 46px;}
.top_over{width: 100%;max-width: 100%;background:#f2f2f2; overflow-x:auto;font-size: 13px;height: 50px;line-height: 50px;}
.top_over1{width: 700px;}
.top_over a{padding: 12px 10px; color: #666;-webkit-text-size-adjust: none;}
.top_over a:hover{color: #43ac43;border-bottom:2px solid #43ac43;}
.top_a_hover{color: #43ac43;border-bottom:2px solid #43ac43;}
.i_d_2{background: #fff;}
.swipslider{padding-top: 50% !important;}
.swipslider .sw-slides{margin: 0 !important;}
.sw-bullet{bottom: 2% !important;}
.sun_dr_d1{width: 100%;margin: 4px 0 4px;height: 100px;overflow: hidden;display: flex;justify-content: center;align-items: center;}
.sun_dr_d1 img{min-width:100%;max-width:100%;min-height: 100px;}
	.position_l{    position: absolute;left: 0;top: 3px;}
header{width: 100%;height: 60px;background-color:#fff;}
.search{padding: 18px 50px 18px 20px;}
.searchInput{position: relative;height: 30px;padding: 0 10px 0 30px;border-radius: 15px;background-color: #eee;}
.searchInput input::-webkit-input-placeholder{ color: #ccc; font-size: 12px;}
.searchInput input{ border-style: none; display: block; width: 100%; height:30px; line-height: 30px; font-size: 12px; color: #626262;background-color: #eee;}
.searchInput:before{content: "";display: block;height: 22px;width: 22px;position: absolute;left: 3px;top:3px;background: url(<?php echo MODULE_URL;?>template/mobile/img/sousuo.png) no-repeat center;background-size: 15px auto; }
.searchInput img{width: 20px;height: 25px;position: absolute;right:-25px;top: 2px;}
.searchInput b{width: 10px;height: 10px;border-radius: 10px; background-color: #fdbe5f;font-size: 10px;color: #f0f0f0;position: absolute;right:-28px;top: -3px;text-align: center;line-height: 10px;}
ul,li{ list-style-type:none;}
#con{ height:40px;padding-left: 65px;position:relative; background-color:#fff; overflow:hidden;margin-top: -5px;}
#con .tipLogo{padding: 3px 5px;border-radius: 3px;border:1px #F5AC33 solid;position: absolute;left: 20px;top:9px;color: #F5AC33;font-size: 12px;line-height: 12px;}
#con ul{padding:0 10px;}
#con ul li{ width:100%; height: 40px;line-height: 40px;color: #888;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;}
#con ul li span{float: left;display:block;}
#con ul li span:first-child{max-width:20%; text-overflow: ellipsis;overflow: hidden;white-space: nowrap;}
#con ul li span:last-child{max-width:80%;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;}
.page-search{width: 100%;height: 100%;position: fixed;left: 0;top:0;z-index: 999;}
.page-search{width: 100%;height: 100%;position: fixed;left: 0;top:0;z-index: 999;}
.page{overflow-y: auto;}
.proj-count{padding: .1rem .16rem;}
.loading{height: .36rem;line-height: .36rem;text-align: center;}
.loading img{ width: 16px;vertical-align: -4px;margin: 0 auto;}
</style>
<link rel="stylesheet" type="text/css" href="<?php echo MODULE_URL;?>template/mobile/css/swipeslider.css"><!-- banner轮播 -->
<link rel="stylesheet" href="<?php echo MODULE_URL;?>template/mobile/css/jquery.skippr.css">
	<div class="page page-search" style="display: none">
		<div class="g-flex search-top">
			<div class="g-flex-m">
				<div href="javascript:;" class="mod-searchbar">
					<form id="searchForm" action="">
						<input type="search" placeholder="搜索公益项目" class="mod-searchbar-input"></form>
					<svg class="icon_m mod-searchbar-icon">
						<use xlink:href="#icon-search"><svg viewBox="0 0 48 48" id="icon-search" fill-rule="evenodd" width="100%" height="100%"><path d="M36.7751535,33.634542 L41.706029,38.5654176 L38.8776019,41.3938447 L33.9858384,36.5020812 C31.2488247,38.6910843 27.7772691,40 24,40 C15.163444,40 8,32.836556 8,24 C8,15.163444 15.163444,8 24,8 C32.836556,8 40,15.163444 40,24 C40,27.6174642 38.7994941,30.9545352 36.7751535,33.634542 Z M24,36 C30.627417,36 36,30.627417 36,24 C36,17.372583 30.627417,12 24,12 C17.372583,12 12,17.372583 12,24 C12,30.627417 17.372583,36 24,36 Z"></path></svg></use>
					</svg>
				</div>
			</div>
			<div class="g-flex-ft">
				<a href="javascript:;" class="search-oprtxt">取消</a></div>
		</div>
		<div class="spage j-cond">
			<div class="spage-block">
				<div class="g-flex spage-block-title">
					<div class="g-flex-m">搜索热词</div>
				</div>
				<div class="spage-tag-list" id="searchKeyWord">
					<a href="javascript:;" class="tag spage-tag">儿童</a>
					<a href="javascript:;" class="tag spage-tag">女性</a>
					<a href="javascript:;" class="tag spage-tag">愿望</a>
					<a href="javascript:;" class="tag spage-tag">一对一</a>
					<a href="javascript:;" class="tag spage-tag">动物保护</a>
					<a href="javascript:;" class="tag spage-tag">爱心</a>
					<a href="javascript:;" class="tag spage-tag">公益</a>
					<a href="javascript:;" class="tag spage-tag">家园</a>
					<a href="javascript:;" class="tag spage-tag">温度</a>
					<a href="javascript:;" class="tag spage-tag">群体</a>
				</div>
			</div>
			<div class="spage-block">
				<div class="g-flex spage-block-title">
					<div class="g-flex-m">项目类型</div></div>
				<div class="spage-tag-list" id="searchType">
					<a href="javascript:;" class="tag spage-tag">全部<span class="clr_dft">({php echo count($pro_lists);})</span></a>
					{loop $class_count $list}
					<a href="javascript:;" class="tag spage-tag" data-id="{$list['class_id']}">{$list['class_name']}<span class="clr_dft">({$list['count']})</span></a>
					{/loop}
				</div>
			</div>
		</div>
		<ul class="spage j-result" style="display: none;">
			<li class="proj-item">
				<div class="proj-count">查到<em data-v-09c680e6="" id="pro_count"></em>个相关项目</div>
			</li>
			<div class="shopping-main" style="padding:0;margin-top:-20px;">
				<div class="list" id="list_rec1">
					
				</div>
			</div>
			<div class="loading" style="display: none;">
				<img data-v-ab44071e="" src="<?php echo MODULE_URL;?>template/mobile/img/loading_1.gif" alt="">
				<span data-v-ab44071e="">加载中...</span>
			</div>
		</ul>
	</div>
	<header>
		<div class="search">
			<div class="searchInput">
				<input type="search" placeholder="搜索公益项目">
				<a href="{php echo $this->createMobileUrl('tip');}">
					<img src="<?php echo MODULE_URL;?>template/mobile/img/xiaoxi.png">
					<b></b>
				</a>
			</div>
		</div>
	</header>
	<div id="con">
		<div class="tipLogo">最 新</div>
		<ul>
		{loop $ftime $list}
			<li><span>{$list['mem_name']}</span><span>&nbsp;&nbsp;{$list['fund_time']}前&nbsp;&nbsp;支持了{$list['pro_name']}爱心项目</span></li>
		{/loop}
		</ul>
	</div>
	<!--	<div class="i_d_2" style="position:relative; padding-left:10px !important;">-->
	<!--		<div class="f_r">-->
	<!--			<div style="display:inline-block;float:left">累计获得</div>-->
	<!--			<div class='clock'></div> 份爱心-->
	<!--			<label id="shuzi" style="display:none;">{$total_fund}</label>-->
	<!--		</div>-->
	<!--		<div style="clear:both"></div>-->
	<!--    	<div class="f_l gy_logo"><img src="{php echo tomedia($set['gy_logo']);}"></div>-->
	<!--     	<div class="clear"></div>-->
	<!--    </div>-->
	<div class="jq22-container">
		<article class="container1">
			<section>
				<figure id="full_feature" class="swipslider">
					<ul class="sw-slides">
						{loop $slides $slide}
						<li class="sw-slide" onclick="javascript:location.href='{$slide['slide_url']}'">
							<img src="{$_W['attachurl']}{$slide['slide_pic']}" title="{$slide['slide_title']}"/>
						</li>
						{/loop}
					</ul>
				</figure>
			</section>
		</article>
	</div>
	<!--
<div class="menubar">
	<a href="{php echo $this->createMobileUrl('agree')}">
		<div class="li">
			<div class="and_img and_healthy"></div>
				<div>爱心条款</div>
		</div>
	</a>
	<a href="{php echo $this->createMobileUrl('catmonth', array('class_name'=>'热点项目'));}">
		<div class="li">
			<div class="and_img and_month"></div>
			<div>热点项目</div>
		</div>
	</a>
	<a href="{php echo $this->createMobileUrl('home');}">
		<div class="li">
			<div class="and_img and_myrecord"></div>
			<div>善款公开</div>
		</div>
	</a>
	<a href="{php echo $this->createMobileUrl('founder');}">
		<div class="li">
			<div class="and_img and_start"></div>
			<div>发起筹款</div>
		</div>
	</a>
</div>-->
	<!--推荐项目-->
	<div class="i_d_3" style="height:auto !important;">
		{loop $feature_list $fea}
		<a href="{php echo $this->createMobileUrl('per', array('pro_id'=>$fea['pro_id']));}">
			<div class="i_d_3_1" style=" border-right:1px solid #f7f7f7; ">
				<div class=" i_d_3_1_img" style=" width:94%;height:100px;overflow:hidden;border-radius:5px; margin:0 3% !important; box-sizing:border-box;">
					<img src="{$_W['attachurl']}{$fea['pro_feature']}" style="min-width:100%;min-height:100px;margin:0 !important; box-sizing:border-box;"/>
				</div>
				<div class=" i_d_3_1_text" style="width:100% !important; padding-top:5px; padding-left:10px !important; box-sizing:border-box;">
					<span class="i_d_t_i">{$fea['pro_name']}</span>
					<div style="margin-top:4px;"> 共￥<span style="color:#d0021b;">{$fea['pro_fund']}</span>元爱心</div>
				</div>
				<div class="clear"></div>
			</div>
		</a>
		{/loop}
		<div class="clear"></div>
	</div>
	<div style="position:relative;background:#fff;width:100%;height:46px;margin-top:10px;" class="bck_btm">
		<div class="list-tips" style='float:left;width:50%;font-size:14px;line-height:46px; color:#565a5d;background:#fff;padding-left:3%;'>公益项目</div>&nbsp;
		<button id="toggle-search" class="header-button">分类查找</button></li>
		<div class="clearfix"></div>
		<form id="search-form" class="bck_btm" action="">
			<div class="top_over">
				<div class="top_over1">
					<a href="javascript:;" class="top_a_hover" style="margin-left:10px;color:#43ac43" id="all" onclick="proshow();">全部</a>
					{loop $classes $val}
					<a href="javascript:;" onclick="proshow('{$val['class_id']}');" id="{$val['class_id']}" >{$val['class_name']}</a>
					{/loop}
					<div class="clearfix"></div>
				</div>
			</div>
		</form>
	</div>

	<script type="text/javascript" src='<?php echo MODULE_URL;?>/template/mobile/js/jquery.min.js'></script>
	<script type="text/javascript" src="<?php echo MODULE_URL;?>/template/mobile/js/swipeslider.min.js"></script><!-- banner图片轮播 -->
	<script>
		$(function() {
			new Swipe($('#banner_box')[0], {
				speed:500,
				auto:3000,
				callback: function(){
					var lis = $(this.element).next("ol").children();
					lis.removeClass("on").eq(this.index).addClass("on");
				}
			});
			var value = $("#shuzi").text().replace(/[^0-9]/ig,"");
			for (var i = 0; i < value.length; i++) {
		   		$(".clock").append(
		   			"<div class="+"'shake shake-slow'"+">"+value[i]+"</div>"
		   		);
	   		}
			//菜单宽度
			var w=30;
			for(var i=0;i<$(".top_over1 a").length;i++){
				w+=$(".top_over1 a").eq(i).outerWidth(true) ;
			}
			if(w<$("body").width()){
				w=$("body").width();
			}else {
				$(".top_over1").width(w);
			}

			//消息滚动
			var scrtime = setInterval(function(){
			   var ul = $("#con ul");
			   var liHeight = ul.find("li:last").height();//计算最后一个li元素的高度
			   ul.animate({marginTop :"-"+liHeight+"px"},1000,function(){
			      ul.find("li:eq(0)").appendTo(ul)
			      //ul.find("li:eq(0)").hide();
			      ul.css({marginTop:0});
			      //ul.find("li:eq(0)").fadeIn(1000);
			   });
			},3000);

		});

		//banner轮播开始
		$(window).load(function() {
	      $('#full_feature').swipeslider();
	      $('#content_slider').swipeslider({
	        transitionDuration: 600,
	        autoPlayTimeout: 10000,
	        sliderHeight: '300px'
	      });
	      $('#responsiveness').swipeslider();
	      $('#customizability').swipeslider({
	        transitionDuration: 1500,
	        autoPlayTimeout: 4000,
	        timingFunction: 'cubic-bezier(0.38, 0.96, 0.7, 0.07)',
	        sliderHeight: '30%'});
	    });
	    //banner轮播结束
	</script>
	<script type="text/javascript">
		(function($) {
			// Handle click on toggle search button
			$('#toggle-search').click(function() {
				$('#search-form, #toggle-search').toggleClass('open');
				return false;
			});

			// Handle click on search submit button
			$('#search-form input[type=submit]').click(function() {
				$('#search-form, #toggle-search').toggleClass('open');
				return true;
			});

			// Clicking outside the search form closes it
			$(document).click(function(event) {
				var target = $(event.target);

				if (!target.is('#toggle-search') && !target.closest('#search-form').size()) {
					$('#search-form, #toggle-search').removeClass('open');
				}
			});
		})(jQuery);

		function proshow(id){
			if(id=='' || id==undefined){
				$('#all').addClass('top_a_hover');
				$('#all').css('color','#43ac43');

				$('#all').siblings().css('color','#000');
				$('#all').siblings().removeClass('top_a_hover');
			}else{
				$('#'+id+'').css('color','#43ac43');
				$('#'+id+'').addClass('top_a_hover');

				$('#'+id+'').siblings().css('color','#000');
				$('#'+id+'').siblings().removeClass('top_a_hover');
			}

			$.ajax({
				type: "post",
				url: '{php echo $this->createMobileUrl("doWelfare",array());}',
			 	data:{'id': id},
			 	dataType: 'json',
			 	success: function(result){
					var options = '';
					$.each(result.pro_list,function(idx,item){
						var math = Math.round((item.pro_fund/item.pro_goal)*10000)/100;
						var url = "{php echo $this->createMobileUrl('per', array());}&pro_id="+item.pro_id;
						var src	= result.url+item.pro_feature;
						options += '<div class="i_d_5"style=""><div class="i_d_5_1"style="padding: 16px 15px 16px 10px;"><a href="'+url+'"><div class="i_d_5_1_l"><img src="'+src+'"></div><div class="i_d_5_1_r"style="padding-right:0 !important;"><div><div><span class="title">'+item.pro_name+'</span></div></div><div style="padding:0 !important; margin:-10px 0 !important;"><div class="progress float_l"style="height:4px; width:74%; margin-top:8px; margin-bottom:15px;"><div class="progress-bar progress-bar-warning"role="progressbar"aria-valuenow="'+item.pro_rate+'"aria-valuemin="0"aria-valuemax="100"style="width: '+item.pro_rate+'%;"></div></div><div class="float_r"style="vertical-align:bottom; width:25%; overflow:hidden; padding-top:0px; text-align:right; padding-right:0px; color:#43ac43;"><span id="bfb_show">'+math+'</span>%</div><div class="clear"></div></div><div class="clear"></div><div style="margin-top:5px;position: relative"><div class="float_l i_show_li position_l">共<span style="color:#d0021b;">￥'+item.pro_fund+'</span>元爱心</div><div class="float_r i_show_li">目标<span style="color:#d0021b;">'+item.pro_goal+'</span>元</div></div></div><div class="clear"></div></a></div></div>';
					});
					if(options==""){
						options="<div style='width: 100%;height: 50px;line-height: 50px;text-align: center;color: #666;'>没有更多了</div>";
					}
					$("#list_rec").html(options);
					$('#toggle-search').removeClass('open');
					$('#search-form').removeClass('open');
				}
		   	})

		}
	</script>

	<div class="shopping-main" style="padding:0;margin-top:-20px;">
 		<div class="list" id="list_rec">
 		{loop $pro_list $list}
			<div class="i_d_5" style="">
  				<div class="i_d_5_1" style="padding: 16px 15px 16px 10px;">
   					<a href="{php echo $this->createMobileUrl('per', array('pro_id'=>$list['pro_id']));}">
    					<div class="i_d_5_1_l">
    						<img src="{$_W['attachurl']}{$list['pro_feature']}">
    					</div>
    					<div class="i_d_5_1_r" style="padding-right:0 !important;">
    						<div>
        						<div><span class="title">{$list['pro_name']}</span></div>
    						</div>
    						<div style="padding:0 !important; margin:-10px 0 !important;">
    							<div class="progress float_l" style="height:4px; width:74%; margin-top:8px; margin-bottom:15px;">
      								<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="{$list['pro_rate']}" aria-valuemin="0" aria-valuemax="100" style="width: {$list['pro_rate']}%;min-width:0px;">
      								</div>
    							</div>
    							<div class="float_r" style="vertical-align:bottom; width:25%; overflow:hidden; padding-top:0px; text-align:right; padding-right:0px; color:#43ac43;">
    								<span id="bfb_show">{php echo round($list['pro_fund']/$list['pro_goal'],4)*100;} </span>%
    							</div>
    							<div class="clear"></div>
    						</div>
    						<div class="clear"></div>
    						<div style="margin-top:5px;position: relative">
     							<div class="float_l i_show_li position_l">
    								共<span style="color:#d0021b;">￥{$list['pro_fund']}</span>元爱心
    							</div>
    							<div class="float_r i_show_li">
    								目标<span style="color:#d0021b;">{$list['pro_goal']}</span>元
    							</div>
    						</div>
    					</div>
    					<div class="clear"></div>
   					</a>
  				</div>
			</div>
	  	{/loop}
	   </div>
	</div>

	<?php if(!empty($adv)) {?>
	<div class="adv" style="width:100%;text-align:center;">
		<div style="margin:10px 0 0 0;position:relative;">
			<span id="adv_close" style="display:inline-block;color:#fff;width:18px;height:18px;border-radius:50%;background-color:rgba(216,214,214,.6);position:absolute;right:1px;top:1px;cursor:pointer">X</span>
			<a href="{$adv['adv_link']}"><div class="sun_dr_d1"><img alt="{$adv['adv_title']}" src="{$_W['attachurl']}{$adv['adv_pic']}"></div></a>
		</div>
	</div>
	<?php } ?>

	<script src="<?php echo MODULE_URL;?>/template/mobile/js/jquery.skippr.min.js"></script>
	<script>
	    $(document).ready(function() {
	        $("#random").skippr();
	        $(".searchInput input").click(function () {
				$(".page-search").show();
				$("#searchForm input").focus();
			});
			$(".search-oprtxt").click(function () {
			   if($(".j-result").is(":hidden")){
			      $(".page-search").hide();
			   }else {
			      $(".j-cond").show();
			      $(".j-result").hide();
			   }
			});

			$("#searchForm").on("submit",function(event){
				//拦截表单默认提交事件
				event.preventDefault();
				
				$(".j-cond").hide();//隐藏其他
				var loading = layer.open({type: 2,content: '加载中'});
				//获取input框的值，用ajax提交到后台
				var content = $(".mod-searchbar-input").val();
				proShows(content,loading);
			});

			$("#searchKeyWord a").click(function () {
				$(".j-cond").hide();//隐藏其他
				var loading = layer.open({type: 2,content: '加载中'});
				var content = $(this).text();
				proShows(content,loading);
			});
	    });
//ajax搜索
function proShows(content,loading){
	$.ajax({
		url: '{php echo $this->createMobileUrl("searchfare");}',
        type: 'post',
        dataType: 'json',
        data: {'content':content},
        success: function(result){
        	var pro_count = result.count;
            var options = '';
			$.each(result.pro_list,function(idx,item){
				var math = Math.round((item.pro_fund/item.pro_goal)*10000)/100;
				var url = "{php echo $this->createMobileUrl('per', array());}&pro_id="+item.pro_id;
				var src	= result.url+item.pro_feature;
				options += '<div class="i_d_5"style=""><div class="i_d_5_1"style="padding: 16px 15px 16px 10px;"><a href="'+url+'"><div class="i_d_5_1_l"><img src="'+src+'"></div><div class="i_d_5_1_r"style="padding-right:0 !important;"><div><div><span class="title">'+item.pro_name+'</span></div></div><div style="padding:0 !important; margin:-10px 0 !important;"><div class="progress float_l"style="height:4px; width:74%; margin-top:8px; margin-bottom:15px;"><div class="progress-bar progress-bar-warning"role="progressbar"aria-valuenow="'+item.pro_rate+'"aria-valuemin="0"aria-valuemax="100"style="width: '+item.pro_rate+'%;"></div></div><div class="float_r"style="vertical-align:bottom; width:25%; overflow:hidden; padding-top:0px; text-align:right; padding-right:0px; color:#43ac43;"><span id="bfb_show">'+math+'</span>%</div><div class="clear"></div></div><div class="clear"></div><div style="margin-top:5px;position: relative"><div class="float_l i_show_li position_l">共<span style="color:#d0021b;">￥'+item.pro_fund+'</span>元爱心</div><div class="float_r i_show_li">目标<span style="color:#d0021b;">'+item.pro_goal+'</span>元</div></div></div><div class="clear"></div></a></div></div>';
			});
			if(options==""){
				options="<div style='width: 100%;height: 50px;line-height: 50px;text-align: center;color: #666;'>没有更多了</div>";
			}
			$("#list_rec1").html(options);
			$("#pro_count").html(pro_count);
			$('#toggle-search').removeClass('open');
			$('#search-form').removeClass('open');
        	layer.close(loading);//关闭loading
			$(".j-result").show();
        },
        error:function(){
			layer.close(loading);//关闭loading
			$(".j-cond").show();//隐藏其他
			$(".j-result").hide();
		}
	})
}

//项目类型搜索
$("#searchType a").click(function () {
   $(".j-cond").hide();//隐藏其他
   var loading = layer.open({type: 2,content: '加载中'});
   var class_id = "";
   var index=$(this).index();
   if(index==0){
      class_id="";
   }else {
      class_id = $(this).attr("data-id");
   }
   $.ajax({
	   	url: '{php echo $this->createMobileUrl("searchclass");}',
	   	type: 'POST',
	   	dataType: 'json',
	   	data: {'class_id':class_id},
	   	success:function(result){
	   		var pro_count = result.count;
            var options = '';
			$.each(result.pro_list,function(idx,item){
				var math = Math.round((item.pro_fund/item.pro_goal)*10000)/100;
				var url = "{php echo $this->createMobileUrl('per', array());}&pro_id="+item.pro_id;
				var src	= result.url+item.pro_feature;
				options += '<div class="i_d_5"style=""><div class="i_d_5_1"style="padding: 16px 15px 16px 10px;"><a href="'+url+'"><div class="i_d_5_1_l"><img src="'+src+'"></div><div class="i_d_5_1_r"style="padding-right:0 !important;"><div><div><span class="title">'+item.pro_name+'</span></div></div><div style="padding:0 !important; margin:-10px 0 !important;"><div class="progress float_l"style="height:4px; width:74%; margin-top:8px; margin-bottom:15px;"><div class="progress-bar progress-bar-warning"role="progressbar"aria-valuenow="'+item.pro_rate+'"aria-valuemin="0"aria-valuemax="100"style="width: '+item.pro_rate+'%;"></div></div><div class="float_r"style="vertical-align:bottom; width:25%; overflow:hidden; padding-top:0px; text-align:right; padding-right:0px; color:#43ac43;"><span id="bfb_show">'+math+'</span>%</div><div class="clear"></div></div><div class="clear"></div><div style="margin-top:5px;position: relative"><div class="float_l i_show_li position_l">共<span style="color:#d0021b;">￥'+item.pro_fund+'</span>元爱心</div><div class="float_r i_show_li">目标<span style="color:#d0021b;">'+item.pro_goal+'</span>元</div></div></div><div class="clear"></div></a></div></div>';
			});
			if(options==""){
				options="<div style='width: 100%;height: 50px;line-height: 50px;text-align: center;color: #666;'>没有更多了</div>";
			}
			$("#list_rec1").html(options);
			$("#pro_count").html(pro_count);
        	layer.close(loading);//关闭loading
			$(".j-result").show();
	   	},
	   	error:function(){
			layer.close(loading);//关闭loading
			$(".j-cond").show();//隐藏其他
			$(".j-result").hide();
		}
    })
});
//--------------------------------------------------------分割线-----------------------------------------------
	</script>
	<script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
 	{php echo register_jssdk(false);}
	<script type="text/javascript">
	    initShare();
	    function initShare(){
	        wx.ready(function () {
	            sharedata = {
	                title: "欢迎进入{$set['gy_name']}主页",
	                desc: "您的每一次善举，都会帮到更多的人，公益事业，感谢有您！",
	                link: window.location.href,
	                imgUrl: "{$_W['attachurl']}{$set['gy_logo']}",
	                success: function(){

	                },
	                cancel: function(){

	                }
	            };
	            wx.onMenuShareAppMessage(sharedata);
	            wx.onMenuShareTimeline(sharedata);
	        });
	    }
	</script>
	{template 'include/footer'}

</div>
    <div style="height:50px;"></div>
	<div class="gy_footer">
		<li class="gy_footer_li bor_top gy_footer_lic">
			<img class="gy_footer_li_img" src="<?php echo MODULE_URL;?>template/mobile/img/gy_11.png">
			<p class="gy_footer_li_p">首页</p>
		</li>
		<a href="{php echo $this->createMobileUrl('founder');}" style="color:#e7e7e7;"><li class="gy_footer_li bor_top">
			<img class="gy_footer_li_img" src="<?php echo MODULE_URL;?>template/mobile/img/gy_4.png">
			<p class="gy_footer_li_p">发起项目</p>
		</li></a>
		<a href="{php echo $this->createMobileUrl('looks');}" style="color:#e7e7e7;"><li class="gy_footer_li bor_top">
			<img class="gy_footer_li_img" src="<?php echo MODULE_URL;?>template/mobile/img/gy_2.png">
			<p class="gy_footer_li_p">公益天地</p>
		</li></a>
		<a href="{php echo $this->createMobileUrl('home');}" style="color:#e7e7e7;"><li class="gy_footer_li bor_top">
			<img class="gy_footer_li_img" src="<?php echo MODULE_URL;?>template/mobile/img/gy_3.png">
			<p class="gy_footer_li_p">我</p>
		</li></a>
	</div>
</body>
</html>
